﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace winform
{
    class Class1
    {
        public static DataTable GetDataTable(string sql) 
        {
            string conString = "server=.;database=.;uid=sa;pwd=1632174115;";
           

            SqlConnection connection = new SqlConnection(conString);
            SqlDataAdapter adapter = new SqlDataAdapter(sql, connection);
            connection.Open();

            DataTable dt = new DataTable();

            adapter.Fill(dt);
            return dt;

        }
    }
}
